package com.msb.servicemap.service;

import com.msb.internalcommon.dto.ResponseResult;
import com.msb.internalcommon.response.DirectionResponse;
import com.msb.servicemap.remote.MapDirectionClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Auther: WuWen
 * @Date: 2023/8/20 - 08 - 20 - 9:56
 * @Description: com.msb.servicemap.service
 * @version: 1.0
 */
@Service
public class DirectionService {

    @Autowired
    MapDirectionClient mapDirectionClient;

    /**
     * 根据起点和终点经纬度确定 时长（分钟）和 距离（米）
     * @param depLongitude
     * @param depLatitude
     * @param destLongitude
     * @param destLatitude
     * @return
     */
    public ResponseResult direction(String depLongitude, String depLatitude, String destLongitude, String destLatitude){

        // 调用地图接口
        DirectionResponse directionResponse = mapDirectionClient.mapDirection(depLongitude, depLatitude, destLongitude, destLatitude);


        return ResponseResult.success(directionResponse);
    }
}
